#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#define MAX 20

int main()
{
	int N = 0;
	scanf("%d", &N);

	int K = 0;
	int count = 0;
	int arr[MAX] = { 0 };
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &K);
		for (int j = 0; j < K; j++)
		{
			scanf("%d", &arr[count++]);
		}
	}

	int ret = 0;
	int cret = 0;
	int sign = 1;
	int findnum = 0;
	scanf("%d", &findnum);
	int arrnum[MAX] = { 0 };
	for (int i = 0; i < findnum; i++)
	{
		scanf("%d", &ret);
		cret++;
		for (int j = 0; j < cret; j++)
		{
			if (ret == arrnum[j])
			{
				sign = 0;
			}
		}
		if (sign == 1)
		{
			arrnum[i] = ret;
		}
		sign = 1;
	}


	int flag = 1;
	int c = 0;
	for (int i = 0; i < findnum; i++)
	{
		for (int j = 0; j < count - 1; j++)
		{
			if (arrnum[i] == arr[j])
			{
				flag = 0;
			}
		}
		if (flag == 1 && arrnum[i] != 0)
		{
			printf("%d ", arrnum[i]);
			c++;
		}
		flag = 1;
	}
	if (c == 0)
	{
		printf("No handsome!\n");
	}

	return 0;
}